﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AlumnesBD
{
    public partial class NouUsuari : Form
    {
        public NouUsuari()
        {
            InitializeComponent();
        }

        private void btnAfegir_Click(object sender, EventArgs e)
        {
            AlumneConversor n = new AlumneConversor();
            n.Nom = txtNom.Text;
            n.Cognom = txtCognom.Text;
            n.ID = int.Parse(txtID.Text);
            n.insert();

            Form1 f = new Form1();
            f.Show();
            this.Hide();

            //txtNom.Clear();
            //txtCognom.Clear();
            //txtID.Clear(); 
        }

        private void btnCancelar_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        private void txtID_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
